Skip to content

Fix 7 bugs from cross-toolbox Matlab vs Python audit#54

Merged
iahncajigas merged 2 commits intomainfrom
fix/audit-bug-fixes
Mar 10, 2026
Merged

Fix 7 bugs from cross-toolbox Matlab vs Python audit#54
iahncajigas merged 2 commits intomainfrom
fix/audit-bug-fixes

Conversation

@iahncajigas
Copy link
Copy Markdown
Contributor

Summary

Comprehensive cross-toolbox audit comparing all Matlab nSTAT classes against their Python equivalents. This PR fixes 7 confirmed Python bugs and adds the full audit report.

Bugs Fixed

ID Class Fix
P1 SignalObj.std() Use ddof=1 to match Matlab's std() (was ddof=0)
P2 SignalObj.alignTime() Add bounds check — only shift when minTime <= marker <= maxTime
P5 SpikeTrainCollection.psthGLM() Full GLM-based PSTH replacing 3-line stub
P6 SpikeTrainCollection.getNSTnames() Honor selectorArray parameter (was returning all names)
P7 SpikeTrainCollection.getUniqueNSTnames() Honor selectorArray parameter
P8 SpikeTrainCollection.getNST() Resample to collection sampleRate on retrieval
P9 CovariateCollection.isCovPresent() Fix off-by-one: index < numCovindex <= numCov

Audit Report

Added AUDIT_REPORT.md documenting:

Test plan

  • All 180 tests pass
  • Paper examples 01 and 02 run successfully with --export-figures
  • isCovPresent test updated to expect correct behavior (Matlab has the same off-by-one bug)

🤖 Generated with Claude Code

Iahn Cajigas and others added 2 commits March 10, 2026 09:16
Bugs fixed:
- SignalObj.std(): use ddof=1 to match Matlab's std() (P1)
- SignalObj.alignTime(): add bounds check matching Matlab (P2)
- SpikeTrainCollection.psthGLM(): full GLM implementation replacing stub (P5)
- SpikeTrainCollection.getNSTnames(): honor selectorArray parameter (P6)
- SpikeTrainCollection.getUniqueNSTnames(): honor selectorArray parameter (P7)
- SpikeTrainCollection.getNST(): resample to collection sampleRate on retrieval (P8)
- CovariateCollection.isCovPresent(): fix off-by-one for index-based lookup (P9)

Also adds AUDIT_REPORT.md with comprehensive cross-toolbox audit findings
covering 11 Matlab bugs, 7 Python bugs, 19+ missing methods, and 18
behavioral differences.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Link M4-M13 bugs to their corresponding GitHub issues (#15-#21).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iahncajigas iahncajigas merged commit 04b9480 into main Mar 10, 2026
13 checks passed
@iahncajigas iahncajigas deleted the fix/audit-bug-fixes branch March 10, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant